/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.gl2jni;

import android.R.bool;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;

import java.io.File;


public class GL2JNIActivity extends Activity {

    GL2JNIView mView;
    public static float x, y;
    public static float x_start, x_end, y_start, y_end;
    private Button mButtonStart;

    @Override protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        
        setContentView(R.layout.main);
        
        mView = new GL2JNIView(getApplication());
        mButtonStart = (Button) findViewById(R.id.buttonStart);
        mButtonStart.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				setContentView(mView);
			}
		});	
    }

	@Override protected void onPause() {
        super.onPause();
        mView.onPause();
    }

    @Override protected void onResume() {
        super.onResume();
        mView.onResume();
    }
    
    @Override public boolean onTouchEvent(MotionEvent event) {    	    	
    	if(event.getAction() == MotionEvent.ACTION_MOVE) {
    		//Log.d("TEST", "ACTION_MOVE");
    		//Log.d("TEST", "x " + event.getX() + "y " + event.getY());
    		x = event.getX();
    		y = event.getY();
    		
    		//Log.d("TEST", "x " + x + "y " + y);
    	}
    	
    	return true;
    	
    }
}
